<template>
	<view>
		<GoodList v-if="modelValue" @close="close"  @click="clickGoodList"></GoodList>
		<Good @click="clickGood" :ProdCode="goodRow?.ProdCode" :ClientCode="ClientCode" v-if="isGoodShow" @close="()=>{
			isGoodShow=false
		}"></Good>
	</view>
</template>

<script lang="uts" setup>
import GoodList from "./GoodList.vue"
import Good from "./Good.vue"
//公共状态
import { useVue  } from '@/utils/useVue.uts'
const { reactive, ref,app,Token,onMounted,watch,http,goToPage,getPrevPageQuery,useAttrs,computed } = useVue()
interface Props {
	modelValue?:boolean,
	ClientCode?:string,
}
const props = withDefaults(defineProps<Props>(), {
})
// 所有未声明的属性都会进入 $attrs
const attrs = useAttrs()
// 合并所有属性（显式 props + attrs）
const allProps = {
  ...props,
  ...attrs
}

const isList=computed({
	get() {
		return props.modelValue;
	},
	set(value) {
		emit('update:modelValue',false)
	},
})
const isGoodShow=ref(false)
const goodRow=ref(null)
const emit = defineEmits(['click','close','update:modelValue'])
const clickGoodList=(row:any)=>{
	isGoodShow.value=true
	goodRow.value=row
}
const clickGood=(row:any)=>{
	isGoodShow.value=false
	close()
}
const close=()=>{
	emit('update:modelValue',false)
	emit('close')
}

onMounted(() => {
})
</script>

<style scoped lang="scss">

</style>
